Skip to content

test(conformance): vendored scenarios + golden harness, close out S2#26

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/conformance-harness
Jul 11, 2026
Merged

test(conformance): vendored scenarios + golden harness, close out S2#26
sepehr-safari merged 1 commit into
mainfrom
feat/conformance-harness

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

What & why

Final slice of S2 — Detection + conformance: the conformance harness that
pins Studio's detection to the toolkit's, and the S2 close-out. This is the
milestone's exit gate — the shared scenarios must match, code-set for code-set.

Changes

  • src/ocpp/conformance/fixtures/*.json — the 15 shared scenario traces,
    exported from the toolkit.
  • src/ocpp/conformance/goldens/*.json — each scenario's expected
    de-duplicated, sorted FailureCode set, generated from the toolkit's own
    evaluateScenario (source of truth, not hand-authored), tagged contract-v1.
  • src/ocpp/conformance/harness.zig — a native test gate: for each fixture,
    run the full engine (parseTrace → buildSessionTimeline → detectFailures),
    dedupe + sort the codes, and assert equality with the golden — the same
    comparison the toolkit's evaluateScenario makes. A missing/extra code fails
    the scenario by name.
  • README.md — documents the contract, regeneration, and versioning.

Result — S2 exit criterion met

15/15 scenarios match the contract-v1 goldens. Studio's independent Zig
implementation now produces the same failure-code sets as the TypeScript toolkit
across every shared scenario. Verified the gate is real: tampering a golden fails
the test with a named diff.

A note on layout

The plan placed conformance/ at the repo root, but the Native SDK zero-config
build embeds test data with @embedFile, which resolves within the source module
root (ADR-0004) — a repo-root import fails the module-root boundary. The vendored
contract therefore lives under src/ocpp/conformance/, keeping the harness fully
hermetic (no runtime file I/O).

Testing

  • native test -Dplatform=null50/50 pass, including the 15-scenario
    conformance gate.
  • native check --strict and zig fmt --check clean.

Closes #22

Lock Studio's detection to the toolkit's over the 15 shared scenarios — the
S2 exit gate — and close out the milestone.

- src/ocpp/conformance/fixtures/*.json — the 15 shared scenario traces,
  exported from the toolkit.
- src/ocpp/conformance/goldens/*.json — each scenario's expected
  de-duplicated, sorted FailureCode set, generated from the toolkit's own
  evaluateScenario (source of truth), tagged contract-v1.
- src/ocpp/conformance/harness.zig — a `native test` gate that runs the full
  engine (parse -> correlate -> detect) over every fixture and asserts its
  detected code set equals the golden, the same comparison the toolkit's
  evaluateScenario makes. 15/15 scenarios match.
- README documents the contract and its regeneration.

The vendored contract lives under src/ so the zero-config build can embed it
(ADR-0004). Marks S2 complete in ROADMAP.md and CURRENT_STATE.md.

Closes #22
@sepehr-safari sepehr-safari added type:test Tests / conformance area:conformance Contract conformance harness priority:high labels Jul 11, 2026
@sepehr-safari
sepehr-safari merged commit 4a73156 into main Jul 11, 2026
3 checks passed
@sepehr-safari
sepehr-safari deleted the feat/conformance-harness branch July 11, 2026 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:conformance Contract conformance harness priority:high type:test Tests / conformance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(conformance): vendored scenarios + golden harness, close out S2

1 participant